package com.joysuch.wwyt.workflow.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * 描述：用户操作类型枚举<br>
 *
 * @author jingwk<br>
 * @version 1.0 <br>
 * 日期:2021年04月15日 上午10:57:00
 */
public enum WorkFlowStatusEnum {

    PROCESSING(0, "处理中"),
    COMPLETED(1, "已完成"),
    DRAFT(5, "草稿");

    private Integer value;

    private String desc;

    WorkFlowStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public final Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<Integer, WorkFlowStatusEnum> lookup = new HashMap<>();

    static {
        for (WorkFlowStatusEnum e : EnumSet.allOf(WorkFlowStatusEnum.class)) {
            lookup.put(e.value, e);
        }
    }

    public static WorkFlowStatusEnum find(Integer value) {
        return lookup.get(value);
    }
}
